package br.edu.ufcg.splab.util.commands;

import java.util.*;

import org.naturalcli.IParameterType;

public class GenerationAlgorithmParameter implements IParameterType {
	private final String[] generationAlgorithms = {"DFS", "parameterizedDFS"};
	
	/**
	 * {@inheritDoc}
	 */
	public String validationMessage(String value) {
		return this.validateParameter(value) ? null : value + " is not a valid generation algorithm.";
	}
	
	/**
	 * {@inheritDoc}
	 */
	public boolean validateParameter(String value) {
		return Arrays.binarySearch(this.generationAlgorithms, value) != -1;
	}
	
	/**
	 * {@inheritDoc}
	 */
	public String getParameterTypeName() {
		return "generationalgorithm";
	}
	
	/**
	 * {@inheritDoc}
	 */
	public Object convertParameterValue(String value) {
		return value;
	}

}
